<template>
    <div id="app">
        <button @click="adduser">点击</button>
        <ul>
          <img v-for="todo in user" :key="todo.id" :src="todo.picUrl">
        </ul>
    </div>
</template>
<script>
    import axios from "axios";
    export default {
        data() {
           return {
              user:""
           }
        },
        methods: {
          adduser(){
            axios.get('http://api.tianapi.com/social/?key=5e561c068ab6f8adaee6b59ef35dad83&num=10').then((response)=> {
              this.user = response.data.newslist;
              console.log(this.user);
            }).catch(function(response) {
              console.log(response); 
            });
          }
        }
    }
</script>
